<template>
	<div>
		<top-bar-no-back :opacity="false" :displayPlaceHolder="true">
			<div class="s-box">
				<div class="back-box" @click="backFun">
					<uv-icon name="arrow-left" color="#fff" size="26"></uv-icon>
				</div>
				<div class="search-box" @click="skipSearchPage" :style="{'height':currentEnv == 'h5OrApp' ? '70rpx' : `${capsuleHeight}px`,'line-height':currentEnv == 'h5OrApp' ? '70rpx' : `${capsuleHeight}px`}">			 	 			 
				<!-- 	<text class="text">搜索</text> -->
					<uv-icon name="search" color="#fff" size="22"></uv-icon>
				</div>
			</div>
		</top-bar-no-back>
		<!-- <top-bar-no-back-trans :topBarShow="topBarShow">
			<div class="s-box s-box-fixed">
				<div class="search-box" @click="$emit('skipSearch')" :style="{'height':currentEnv == 'h5OrApp' ? '70rpx' : `${capsuleHeight}px`,'line-height':currentEnv == 'h5OrApp' ? '70rpx' : `${capsuleHeight}px`}">
					<uv-icon name="search" color="#909399" size="22"></uv-icon>				 
				</div>
			</div>
		</top-bar-no-back-trans> -->
	</div>
</template>
<script setup>
	import {defineProps} from "vue";
	import {storeToRefs} from 'pinia';
	import {useSystemStore} from "@/stores/system.js";
	import topBarNoBack from '@/components/topBarNoBack/index.vue';
	import topBarNoBackTrans from '@/components/topBarNoBackTrans/index.vue';
	const systemStore=useSystemStore();
	const {currentEnv,capsuleHeight}=storeToRefs(systemStore);
	const props=defineProps({
		topBarShow:{
			type:Boolean,
			default:false
		}
	});
	const backFun=()=>{
		const pages = getCurrentPages();
		if (pages.length > 1) {
			uni.navigateBack({
				delta: 1
			});
		} else {
			uni.switchTab({
				url: '/pages/index/index',
				fail: function(err) {
				
				},
			}); //app端分享后页面栈为1
		}
	}
	const skipSearchPage=()=>{
		uni.navigateTo({
			url:'/pages/subPackageA/searchPage/index'
		})
	}
</script>
<style lang="scss" scoped>
	.s-box{
		//padding:0 42.31rpx 0 22.46rpx;
		padding:0 10rpx 0 0rpx;
		box-sizing: border-box;
		display:flex;
		align-items: center;
		.back-box{
			margin-right:20rpx;
		}
		.search-box{
			box-sizing: border-box;
			width:100%;
			display:flex;
			align-items: center;
			justify-content: flex-end;
			 background: rgba(30,30,30,1);
			 border-radius: 10rpx;
			 border: 1rpx solid rgba(30,30,30,1);
			 padding:0 10px;
			margin-right:16rpx;  
			.text{
				margin:0 5px;
				 color:#fff;
				 font-size: 27rpx;
				 font-family: PingFangSC, PingFang SC;
				 font-weight: 400;
			   
			}
			    
		}
		&.s-box-fixed{
			.search-box{
				 background: rgba(185,195,201,0.2);
			}
					 
		}
	}
</style>